import React, {Component} from 'react';

import {
    View,
    Text,
    StyleSheet,
} from 'react-native';
import NavigationBar from "../../common/NavigationBar";
import CustomerKeysPage from "./CustomerKeysPage";
import SortKeysPage from "./SortKeysPage";
import LanguageDao, {FLAG_LANGUAGE} from "../../expand/Dao/LanguageDao";

export default class MyPage extends Component {
    constructor(props) {
        super(props)
        this.state = {}
    }

    render() {
        return (
            <View>
                <NavigationBar title='我的'/>
                <Text
                    onPress={() => {
                        this.props.navigator.push({
                            component: CustomerKeysPage,
                            params   : {
                                ...this.props,
                                flag:FLAG_LANGUAGE.flag_key
                            }
                        })
                    }}
                >自定义标签</Text>
                <Text
                    onPress={() => {
                        this.props.navigator.push({
                            component: CustomerKeysPage,
                            params   : {
                                ...this.props,
                                flag:FLAG_LANGUAGE.flag_language
                            }
                        })
                    }}
                >自定义语言</Text>

                <Text
                    onPress={() => {
                        this.props.navigator.push({
                            component: SortKeysPage,
                            params   : {
                                ...this.props,
                                flag:FLAG_LANGUAGE.flag_key
                            }
                        })
                    }}
                >标签排序</Text>

                <Text
                    onPress={() => {
                        this.props.navigator.push({
                            component: SortKeysPage,
                            params   : {
                                ...this.props,
                                flag:FLAG_LANGUAGE.flag_language
                            }
                        })
                    }}
                >语言排序</Text>

                <Text
                    onPress={() => {
                        this.props.navigator.push({
                            component: CustomerKeysPage,
                            params   : {
                                ...this.props,
                                flag:FLAG_LANGUAGE.flag_key,
                                isRemoveKey: true
                            }
                        })
                    }}
                >移除标签</Text>

                <Text
                    onPress={() => {
                        this.languageDao = new LanguageDao()
                        this.languageDao.clear()
                    }}
                >清空缓存</Text>
            </View>
        )
    }
}

const styles = StyleSheet.create({})
